package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FOSDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("./fos.dat");
        fos.write(1);
        fos.write(2);
        System.out.println("写入成功");
        fos.close();

        FileOutputStream fos2=new FileOutputStream("./fos.txt");
        //97的int型，字节码为00000000 00000000 00000000 01100001
        fos2.write(97);
        //写入所有小写字母
        for(char c='a';c<='z';c++){
            fos2.write(c);
        }

        System.out.printf("写出完毕");
        fos2.close();
    }
}
